"""扫描任务模型"""
from sqlalchemy import Column, Integer, String, Text, DateTime, func
from app.database import Base


class ScanTask(Base):
    """扫描任务表"""
    __tablename__ = "scan_tasks"

    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(100), nullable=False, unique=True, comment="任务名称")
    task_type = Column(String(50), nullable=False, unique=True, comment="任务类型标识")
    description = Column(Text, comment="任务描述")
    status = Column(String(20), default="enabled", comment="状态: enabled/disabled")
    created_at = Column(DateTime, server_default=func.now(), comment="创建时间")
    updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now(), comment="更新时间")

